﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmartMathLibrary.NumericalIntegration
{
    /// <summary>
    /// This class represents a bivariate integral.
    /// </summary>
    [Serializable]
    public class BivariateIntegral : IBivariateIntegral
    {
        /// <summary>
        /// This field holds the first dimension lower bound of the integral.
        /// </summary>
        private double a1;

        /// <summary>
        /// This field holds the second dimension lower bound of the integral.
        /// </summary>
        private double a2;

        /// <summary>
        /// This field holds the first dimension upper bound of the integral.
        /// </summary>
        private double b1;

        /// <summary>
        /// This field holds the second dimension upper bound of the integral.
        /// </summary>
        private double b2;

        /// <summary>
        /// This field holds the function of the integral.
        /// </summary>
        private IHardBivariateRealFunction function;

        /// <summary>
        /// Initializes a new instance of the <see cref="BivariateIntegral"/> class.
        /// </summary>
        /// <param name="a1">The first dimension lower bound of the integral.</param>
        /// <param name="b1">The first dimension upper bound of the integral.</param>
        /// <param name="a2">The second dimension lower bound of the integral.</param>
        /// <param name="b2">The second dimension upper bound of the integral.</param>
        /// <param name="function">The function of the integral.</param>
        public BivariateIntegral(double a1, double b1, double a2, double b2, IHardBivariateRealFunction function)
        {
            this.a1 = a1;
            this.a2 = a2;
            this.b1 = b1;
            this.b2 = b2;
            this.function = function;
        }

        /// <summary>
        /// Gets or sets the first dimension lower bound of the integral.
        /// </summary>
        /// <value>The first dimension lower bound of the integral.</value>
        public double A1
        {
            get { return a1; }
            set { a1 = value; }
        }

        /// <summary>
        /// Gets or sets the second dimension lower bound of the integral.
        /// </summary>
        /// <value>The second dimension lower bound of the integral.</value>
        public double A2
        {
            get { return a2; }
            set { a2 = value; }
        }

        /// <summary>
        /// Gets or sets the first dimension upper bound of the integral.
        /// </summary>
        /// <value>The first dimension upper bound of the integral.</value>
        public double B1
        {
            get { return b1; }
            set { b1 = value; }
        }

        /// <summary>
        /// Gets or sets the second dimension upper bound of the integral.
        /// </summary>
        /// <value>The second dimension upper bound of the integral.</value>
        public double B2
        {
            get { return b2; }
            set { b2 = value; }
        }

        /// <summary>
        /// Gets or sets the function of the integral.
        /// </summary>
        /// <value>The function of the integral.</value>
        public IHardBivariateRealFunction Function
        {
            get { return function; }
            set { function = value; }
        }
    }
}